package com.pawelsekara.curves;

import org.andengine.entity.scene.Scene;

public class SceneManager {
	
	private static SceneManager mSceneManager;
	public static CurvesGame curvesgame;
	private Scene mScene;
	
	public static SceneManager getManager() {
		if(curvesgame == null) {
			throw new IllegalStateException("You must first initialize SceneManager class!");
		}
		if(mSceneManager == null) {
			return mSceneManager = new SceneManager();
		}
		return mSceneManager;
	}
	
	private SceneManager() {
		super();
	}
	
	public static void init(CurvesGame pCurvesGame) {
		SceneManager.curvesgame = pCurvesGame;
	}
	
	public void setScene(Scene pScene) {
		mScene = pScene;
		curvesgame.getEngine().setScene(pScene);
	}
	
	public Scene getCurrentScene() {
		return mScene;
	}
}
